OrmLiteCacheClient<TCacheEntry>
Assembly: ServiceStack.Server.dll
View Source
Declaration
public class OrmLiteCacheClient<TCacheEntry> : object, ICacheClientAsync, IRemoveByPatternAsync, IRequiresSchema, ICacheClientExtended, ICacheClient, IRemoveByPattern where TCacheEntry : ICacheEntry, new()
Properties
DbFactory
View Source
Declaration
public IDbConnectionFactory DbFactory { get; set; }
Methods
ExecAsync<T>(Func<IDbConnection, Task<T>>, CancellationToken)
View Source
Declaration
public async Task<T> ExecAsync<T>(Func<IDbConnection, Task<T>> action, CancellationToken token = null)
Returns
Task<<T>>
Parameters
Type | Name |
---|---|
Func<IDbConnection,Task<<T>>> | action |
CancellationToken | token |
Type Parameters
T
ExecAsync(Func<IDbConnection, Task>, CancellationToken)
View Source
Declaration
public async Task ExecAsync(Func<IDbConnection, Task> action, CancellationToken token = null)
Returns
Task
Parameters
Type | Name |
---|---|
Func<IDbConnection,Task> | action |
CancellationToken | token |
RemoveAsync(String, CancellationToken)
View Source
Declaration
public async Task<bool> RemoveAsync(string key, CancellationToken token = null)
Returns
Task<System.Boolean>
Parameters
Type | Name |
---|---|
System.String | key |
CancellationToken | token |
RemoveAllAsync(IEnumerable<String>, CancellationToken)
View Source
Declaration
public async Task RemoveAllAsync(IEnumerable<string> keys, CancellationToken token = null)
Returns
Task
Parameters
Type | Name |
---|---|
IEnumerable<System.String> | keys |
CancellationToken | token |
GetAsync<T>(String, CancellationToken)
View Source
Declaration
public async Task<T> GetAsync<T>(string key, CancellationToken token = null)
Returns
Task<<T>>
Parameters
Type | Name |
---|---|
System.String | key |
CancellationToken | token |
Type Parameters
T
IncrementAsync(String, UInt32, CancellationToken)
View Source
Declaration
public async Task<long> IncrementAsync(string key, uint amount, CancellationToken token = null)
Returns
Task<System.Int64>
Parameters
Type | Name |
---|---|
System.String | key |
System.UInt32 | amount |
CancellationToken | token |
DecrementAsync(String, UInt32, CancellationToken)
View Source
Declaration
public async Task<long> DecrementAsync(string key, uint amount, CancellationToken token = null)
Returns
Task<System.Int64>
Parameters
Type | Name |
---|---|
System.String | key |
System.UInt32 | amount |
CancellationToken | token |
AddAsync<T>(String, T, CancellationToken)
View Source
Declaration
public async Task<bool> AddAsync<T>(string key, T value, CancellationToken token = null)
Returns
Task<System.Boolean>
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
CancellationToken | token |
Type Parameters
T
SetAsync<T>(String, T, CancellationToken)
View Source
Declaration
public async Task<bool> SetAsync<T>(string key, T value, CancellationToken token = null)
Returns
Task<System.Boolean>
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
CancellationToken | token |
Type Parameters
T
ReplaceAsync<T>(String, T, CancellationToken)
View Source
Declaration
public async Task<bool> ReplaceAsync<T>(string key, T value, CancellationToken token = null)
Returns
Task<System.Boolean>
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
CancellationToken | token |
Type Parameters
T
AddAsync<T>(String, T, DateTime, CancellationToken)
View Source
Declaration
public async Task<bool> AddAsync<T>(string key, T value, DateTime expiresAt, CancellationToken token = null)
Returns
Task<System.Boolean>
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
DateTime | expiresAt |
CancellationToken | token |
Type Parameters
T
SetAsync<T>(String, T, DateTime, CancellationToken)
View Source
Declaration
public async Task<bool> SetAsync<T>(string key, T value, DateTime expiresAt, CancellationToken token = null)
Returns
Task<System.Boolean>
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
DateTime | expiresAt |
CancellationToken | token |
Type Parameters
T
ReplaceAsync<T>(String, T, DateTime, CancellationToken)
View Source
Declaration
public async Task<bool> ReplaceAsync<T>(string key, T value, DateTime expiresAt, CancellationToken token = null)
Returns
Task<System.Boolean>
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
DateTime | expiresAt |
CancellationToken | token |
Type Parameters
T
AddAsync<T>(String, T, TimeSpan, CancellationToken)
View Source
Declaration
public async Task<bool> AddAsync<T>(string key, T value, TimeSpan expiresIn, CancellationToken token = null)
Returns
Task<System.Boolean>
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
TimeSpan | expiresIn |
CancellationToken | token |
Type Parameters
T
SetAsync<T>(String, T, TimeSpan, CancellationToken)
View Source
Declaration
public async Task<bool> SetAsync<T>(string key, T value, TimeSpan expiresIn, CancellationToken token = null)
Returns
Task<System.Boolean>
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
TimeSpan | expiresIn |
CancellationToken | token |
Type Parameters
T
ReplaceAsync<T>(String, T, TimeSpan, CancellationToken)
View Source
Declaration
public async Task<bool> ReplaceAsync<T>(string key, T value, TimeSpan expiresIn, CancellationToken token = null)
Returns
Task<System.Boolean>
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
TimeSpan | expiresIn |
CancellationToken | token |
Type Parameters
T
FlushAllAsync(CancellationToken)
View Source
Declaration
public async Task FlushAllAsync(CancellationToken token = null)
Returns
Task
Parameters
Type | Name |
---|---|
CancellationToken | token |
GetAllAsync<T>(IEnumerable<String>, CancellationToken)
View Source
Declaration
public async Task<IDictionary<string, T>> GetAllAsync<T>(IEnumerable<string> keys, CancellationToken token = null)
Returns
Task<IDictionary<System.String,<T>>>
Parameters
Type | Name |
---|---|
IEnumerable<System.String> | keys |
CancellationToken | token |
Type Parameters
T
SetAllAsync<T>(IDictionary<String, T>, CancellationToken)
View Source
Declaration
public async Task SetAllAsync<T>(IDictionary<string, T> values, CancellationToken token = null)
Returns
Task
Parameters
Type | Name |
---|---|
IDictionary<System.String,<T>> | values |
CancellationToken | token |
Type Parameters
T
GetTimeToLiveAsync(String, CancellationToken)
View Source
Declaration
public async Task<TimeSpan?> GetTimeToLiveAsync(string key, CancellationToken token = null)
Returns
Task<System.Nullable<TimeSpan>>
Parameters
Type | Name |
---|---|
System.String | key |
CancellationToken | token |
RemoveByPatternAsync(String, CancellationToken)
View Source
Declaration
public async Task RemoveByPatternAsync(string pattern, CancellationToken token = null)
Returns
Task
Parameters
Type | Name |
---|---|
System.String | pattern |
CancellationToken | token |
GetKeysByPatternAsync(String, CancellationToken)
View Source
Declaration
public async IAsyncEnumerable<string> GetKeysByPatternAsync(string pattern, CancellationToken token = null)
Returns
IAsyncEnumerable<System.String>
Parameters
Type | Name |
---|---|
System.String | pattern |
CancellationToken | token |
DisposeAsync()
View Source
Declaration
public ValueTask DisposeAsync()
Returns
ValueTask
RemoveExpiredEntriesAsync(CancellationToken)
View Source
Declaration
public async Task RemoveExpiredEntriesAsync(CancellationToken token = null)
Returns
Task
Parameters
Type | Name |
---|---|
CancellationToken | token |
RemoveByRegexAsync(String, CancellationToken)
View Source
Declaration
public Task RemoveByRegexAsync(string regex, CancellationToken token = null)
Returns
Task
Parameters
Type | Name |
---|---|
System.String | regex |
CancellationToken | token |
Exec<T>(Func<IDbConnection, T>)
View Source
Declaration
public T Exec<T>(Func<IDbConnection, T> action)
Returns
<T>
Parameters
Type | Name |
---|---|
Func<IDbConnection,<T>> | action |
Type Parameters
T
Exec(Action<IDbConnection>)
View Source
Declaration
public void Exec(Action<IDbConnection> action)
Parameters
Type | Name |
---|---|
Action<IDbConnection> | action |
Remove(String)
View Source
Declaration
public bool Remove(string key)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | key |
RemoveAll(IEnumerable<String>)
View Source
Declaration
public void RemoveAll(IEnumerable<string> keys)
Parameters
Type | Name |
---|---|
IEnumerable<System.String> | keys |
Get<T>(String)
View Source
Declaration
public T Get<T>(string key)
Returns
<T>
Parameters
Type | Name |
---|---|
System.String | key |
Type Parameters
T
Increment(String, UInt32)
View Source
Declaration
public long Increment(string key, uint amount)
Returns
System.Int64
Parameters
Type | Name |
---|---|
System.String | key |
System.UInt32 | amount |
Decrement(String, UInt32)
View Source
Declaration
public long Decrement(string key, uint amount)
Returns
System.Int64
Parameters
Type | Name |
---|---|
System.String | key |
System.UInt32 | amount |
Add<T>(String, T)
View Source
Declaration
public bool Add<T>(string key, T value)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
Type Parameters
T
Set<T>(String, T)
View Source
Declaration
public bool Set<T>(string key, T value)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
Type Parameters
T
Replace<T>(String, T)
View Source
Declaration
public bool Replace<T>(string key, T value)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
Type Parameters
T
Add<T>(String, T, DateTime)
View Source
Declaration
public bool Add<T>(string key, T value, DateTime expiresAt)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
DateTime | expiresAt |
Type Parameters
T
Set<T>(String, T, DateTime)
View Source
Declaration
public bool Set<T>(string key, T value, DateTime expiresAt)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
DateTime | expiresAt |
Type Parameters
T
Replace<T>(String, T, DateTime)
View Source
Declaration
public bool Replace<T>(string key, T value, DateTime expiresAt)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
DateTime | expiresAt |
Type Parameters
T
Add<T>(String, T, TimeSpan)
View Source
Declaration
public bool Add<T>(string key, T value, TimeSpan expiresIn)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
TimeSpan | expiresIn |
Type Parameters
T
Set<T>(String, T, TimeSpan)
View Source
Declaration
public bool Set<T>(string key, T value, TimeSpan expiresIn)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
TimeSpan | expiresIn |
Type Parameters
T
Replace<T>(String, T, TimeSpan)
View Source
Declaration
public bool Replace<T>(string key, T value, TimeSpan expiresIn)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | key |
<T> | value |
TimeSpan | expiresIn |
Type Parameters
T
FlushAll()
View Source
Declaration
public void FlushAll()
GetAll<T>(IEnumerable<String>)
View Source
Declaration
public IDictionary<string, T> GetAll<T>(IEnumerable<string> keys)
Returns
IDictionary<System.String,<T>>
Parameters
Type | Name |
---|---|
IEnumerable<System.String> | keys |
Type Parameters
T
SetAll<T>(IDictionary<String, T>)
View Source
Declaration
public void SetAll<T>(IDictionary<string, T> values)
Parameters
Type | Name |
---|---|
IDictionary<System.String,<T>> | values |
Type Parameters
T
InitSchema()
View Source
Declaration
public void InitSchema()
Verify(IDbConnection, IEnumerable<TCacheEntry>)
View Source
Declaration
public List<TCacheEntry> Verify(IDbConnection db, IEnumerable<TCacheEntry> entries)
Returns
List<<TCacheEntry>>
Parameters
Type | Name |
---|---|
IDbConnection | db |
IEnumerable<<TCacheEntry>> | entries |
Verify(IDbConnection, TCacheEntry)
View Source
Declaration
public TCacheEntry Verify(IDbConnection db, TCacheEntry entry)
Returns
<TCacheEntry>
Parameters
Type | Name |
---|---|
IDbConnection | db |
<TCacheEntry> | entry |
GetTimeToLive(String)
View Source
Declaration
public TimeSpan? GetTimeToLive(string key)
Returns
System.Nullable<TimeSpan>
Parameters
Type | Name |
---|---|
System.String | key |
RemoveByPattern(String)
View Source
Declaration
public void RemoveByPattern(string pattern)
Parameters
Type | Name |
---|---|
System.String | pattern |
GetKeysByPattern(String)
View Source
Declaration
public IEnumerable<string> GetKeysByPattern(string pattern)
Returns
IEnumerable<System.String>
Parameters
Type | Name |
---|---|
System.String | pattern |
RemoveExpiredEntries()
View Source
Declaration
public void RemoveExpiredEntries()
RemoveByRegex(String)
View Source
Declaration
public void RemoveByRegex(string regex)
Parameters
Type | Name |
---|---|
System.String | regex |
Dispose()
View Source
Declaration
public void Dispose()